﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_ThanhToanNhaCungCap : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNganhang")]
        private ADVObjects _AdvNganhang;
        [AccessedThroughProperty("advNhaCungCap")]
        private ADVObjects _advNhaCungCap;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("AdvTaiKhoan")]
        private ADVAccount _AdvTaiKhoan;
        [AccessedThroughProperty("AdvTKNo")]
        private ADVAccount _AdvTKNo;
        [AccessedThroughProperty("Button1")]
        private Button _Button1;
        [AccessedThroughProperty("CboHinhThuc")]
        private ComboBox _CboHinhThuc;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKCheckAll")]
        private CheckBox _CKCheckAll;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabDetails")]
        private TabControl _TabDetails;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChungTuDinhKem")]
        private TextBox _TxtChungTuDinhKem;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoTien")]
        private C1NumericEdit _TxtSoTien;
        [AccessedThroughProperty("TxtSoTienKPB")]
        private C1NumericEdit _TxtSoTienKPB;
        [AccessedThroughProperty("TxtSoTienKPBNT")]
        private C1NumericEdit _TxtSoTienKPBNT;
        [AccessedThroughProperty("TxtSoTienNT")]
        private C1NumericEdit _TxtSoTienNT;
        [AccessedThroughProperty("TxtSoTienThanhToan")]
        private C1NumericEdit _TxtSoTienThanhToan;
        [AccessedThroughProperty("TxtSoTienThanhToanNT")]
        private C1NumericEdit _TxtSoTienThanhToanNT;
        [AccessedThroughProperty("TxtTongSoDuNo")]
        private C1NumericEdit _TxtTongSoDuNo;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsSoChungTu objSoCT;
        private clsThanhToan objTT;
        private clsThanhToanChiTiet objTTCT;
        ComponentResourceManager manager;

        public Frm_ThanhToanNhaCungCap()
        {
            base.Load += new EventHandler(this.Frm_PhieuThu_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "TTCC";
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objSoCT = new clsSoChungTu();
            this.objTT = new clsThanhToan();
            this.objTTCT = new clsThanhToanChiTiet();
            this.InitializeComponent();
        }

        private void advKhachHang_ValueChanged(object sender, EventArgs e)
        {
            this.LoadThanhToan();
            double num = new clsDMDoiTuong().GetSoDuCongNo(this.advNhaCungCap.Value, LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), "CO", modGeneral.H_CLIENT, "331");
            this.TxtTongSoDuNo.Value = num;
        }

        private void AdvNhanVien_ValueChanged(object sender, EventArgs e)
        {
            this.LoadThanhToan();
        }

        private void AdvTaiKhoan_ValueChanged(object sender, EventArgs e)
        {
            clsDMTaiKhoan khoan = new clsDMTaiKhoan();
            if (khoan.Load(this.AdvTaiKhoan.Value))
            {
                this.CboLoaiTien.SelectedValue = khoan.LoaiTien;
                this.CboLoaiTien_SelectedIndexChanged(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void CboHinhThuc_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboHinhThuc.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "CK")
            {
                this.AdvNganhang.ReadOnly = false;
                this.AdvTaiKhoan.KeyFilter = "112";
            }
            else
            {
                this.AdvNganhang.Value = "";
                this.AdvTaiKhoan.KeyFilter = "111";
                this.AdvNganhang.ReadOnly = true;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = this.CboLoaiTien.SelectedValue.ToString();
                if (strCode != "System.Data.DataRowView")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    this.txtTyGia.Value = tien.TyGia;
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    this.FormatNumber();
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                    {
                        this.TxtSoTienThanhToanNT.ReadOnly = false;
                    }
                    else
                    {
                        this.TxtSoTienThanhToanNT.Value = 0;
                        this.TxtSoTienThanhToanNT_LostFocus(RuntimeHelpers.GetObjectValue(sender), e);
                        this.TxtSoTienThanhToanNT.ReadOnly = true;
                    }
                }
            }
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (this.AdvTaiKhoan.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số t\x00e0i khoản!", ""));
                this.AdvTaiKhoan.Focus();
                return false;
            }
            if (this.TxtDienGiai.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập diễn giải của chứng từ!", ""));
                this.TxtDienGiai.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số tiền thanh to\x00e1n!", ""));
                return false;
            }
            if (this.objTT.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if ((Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienKPBNT.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0) && (this.AdvTKNo.Value.Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản nợ!", ""));
                this.AdvTKNo.Focus();
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(LVYModule.SumColGrid(this.VSlist, 15), this.TxtSoTienThanhToan.Value, false))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng kiểm tra lại số tiền thanh to\x00e1n!", ""));
                this.TxtSoTienThanhToanNT.Focus();
                return false;
            }
            return true;
        }

        public bool CheckIvalidGrid()
        {
            bool flag=false;
            return flag;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("BH_ThanhToanhNhaCungCap", 15, "PA");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.AdvTaiKhoan.Value = LVYModule.ReturnIfNull(modGeneral.H_ACCNORECEIPTNOTE, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.InitDefaultValue();
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.cFrmKhoa != "") && LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text))) && (LVYModule.ConfirmDelete("") && this.objTT.DeleteData(this.cFrmKhoa)))
            {
                this.EmptyData();
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.LoadThanhToanEdit();
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            try
            {
                MyProject.Forms.Frm_ThanhToanNhaCungCapList.ShowDialog();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                ProjectData.ClearProjectError();
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintThanhToanNCC(this.cFrmKhoa);
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveDetailsTemp())
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.UpdateData())
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objTT.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoaOld.Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.cFrmKhoa = "";
                this.EmptyData();
            }
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.TxtChungTuDinhKem.Text = "";
            this.AdvTaiKhoan.Value = "";
            this.VSlist.Rows.Count = 1;
            this.advNhaCungCap.Value = "";
            this.TxtSoTienThanhToanNT.Value = 0;
            this.TxtSoTienThanhToan.Value = 0;
            this.VSlist.Rows.Count = 1;
            this.TxtTongSoDuNo.Value = 0;
            this.TxtSoTienKPBNT.Value = 0;
            this.TxtSoTienKPB.Value = 0;
            this.AdvTKNo.Value = "";
            this.TxtSoTienNT.Value = 0;
            this.TxtSoTien.Value = 0;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTien, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtSoTienThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienThanhToan, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtSoTienKPBNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienKPB, modGeneral.H_FORMATNUMBER);
            this.VSlist.Cols[10].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[11].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[12].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[13].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[14].DataType = System.Type.GetType("System.Decimal");
            this.VSlist.Cols[10].Format = this.cFrmFormat;
            this.VSlist.Cols[11].Format = this.cFrmFormat;
            this.VSlist.Cols[12].Format = this.cFrmFormat;
            this.VSlist.Cols[13].Format = this.cFrmFormat;
            this.VSlist.Cols[14].Format = this.cFrmFormat;
        }

        private void Frm_PhieuThu_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                this.initComboHinhThuc();
                this.CboHinhThuc.SelectedValue = "TM";
                string strFormat = "###,###,###,###,###,###,##0.00";
                LVYModule.advFormatNumber(this.TxtTongSoDuNo, strFormat);
                if (this.cFrmKhoa.Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
            SetEvents();
        }

        public void initComboHinhThuc()
        {
            object instance = new DataTable();
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Columns", new object[0], null, null, null), null, "Add", new object[] { "Ma", System.Type.GetType("System.String") }, null, null, null, true);
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Columns", new object[0], null, null, null), null, "Add", new object[] { "Ten", System.Type.GetType("System.String") }, null, null, null, true);
            DataRow row = (DataRow) NewLateBinding.LateGet(instance, null, "NewRow", new object[0], null, null, null);
            row[0] = "TM";
            row[1] = modGeneral.Tranlated("Tiền mặt", "");
            object[] arguments = new object[] { row };
            bool[] copyBack = new bool[] { true };
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Rows", new object[0], null, null, null), null, "Add", arguments, null, null, copyBack, true);
            if (copyBack[0])
            {
                row = (DataRow) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(DataRow));
            }
            row = (DataRow) NewLateBinding.LateGet(instance, null, "NewRow", new object[0], null, null, null);
            row[0] = "CK";
            row[1] = modGeneral.Tranlated("Chuyển khoản", "");
            object[] objArray = new object[] { row };
            copyBack = new bool[] { true };
            NewLateBinding.LateCall(NewLateBinding.LateGet(instance, null, "Rows", new object[0], null, null, null), null, "Add", objArray, null, null, copyBack, true);
            if (copyBack[0])
            {
                row = (DataRow) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(objArray[0]), typeof(DataRow));
            }
            this.CboHinhThuc.DataSource = RuntimeHelpers.GetObjectValue(instance);
            this.CboHinhThuc.ValueMember = "Ma";
            this.CboHinhThuc.DisplayMember = "Ten";
        }

        public void InitDefaultValue()
        {
            this.AdvTaiKhoan.Value = modGeneral.H_DEFAULT.Item("H_TTCC_TKCHU").GiaTri.ToString().Trim();
            EventArgs e = new EventArgs();
            this.AdvTaiKhoan_ValueChanged(this, e);
            this.AdvTKNo.Value = modGeneral.H_DEFAULT.Item("H_TTCC_TKNO").GiaTri.ToString().Trim();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            manager = new ComponentResourceManager(typeof(Frm_ThanhToanNhaCungCap));
            this._Label15 = new Label();
            this._Button1 = new Button();
            this._TxtTongSoDuNo = new C1NumericEdit();
            this._Label14 = new Label();
            this._Label12 = new Label();
            this._Label8 = new Label();
            this._TxtSoTienThanhToan = new C1NumericEdit();
            this._TxtSoTienThanhToanNT = new C1NumericEdit();
            this._TabControl1 = new TabControl();
            this._TabPage1 = new TabPage();
            this._Label7 = new Label();
            this._CboHinhThuc = new ComboBox();
            this._Label6 = new Label();
            this._Label4 = new Label();
            this._TxtDienGiai = new TextBox();
            this._Label9 = new Label();
            this._TxtChungTuDinhKem = new TextBox();
            this._Label3 = new Label();
            this._CboLoaiTien = new ComboBox();
            this._txtTyGia = new C1NumericEdit();
            this._Label11 = new Label();
            this._Label10 = new Label();
            this._Label2 = new Label();
            this._Label13 = new Label();
            this._TxtNgayChungTu = new DateTimePicker();
            this._Label1 = new Label();
            this._TxtSoChungTu = new TextBox();
            this._ToolStrip1 = new ToolStrip();
            this._CmdAdd = new ToolStripButton();
            this._CmdEdit = new ToolStripButton();
            this._ToolStripSeparator2 = new ToolStripSeparator();
            this._CmdSave = new ToolStripButton();
            this._CmdUnsave = new ToolStripButton();
            this._ToolStripSeparator1 = new ToolStripSeparator();
            this._CmdFind = new ToolStripButton();
            this._CmdPrint = new ToolStripButton();
            this._ToolStripButton1 = new ToolStripSeparator();
            this._CmdDel = new ToolStripButton();
            this._ToolStripSeparator3 = new ToolStripSeparator();
            this._CmdExit = new ToolStripButton();
            this._CmdHelp = new ToolStripButton();
            this._TxtSoTien = new C1NumericEdit();
            this._Panel5 = new Panel();
            this._TxtSoTienNT = new C1NumericEdit();
            this._Label5 = new Label();
            this._TabPage2 = new TabPage();
            this._CKCheckAll = new CheckBox();
            this._VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this._TabDetails = new TabControl();
            this._TxtSoTienKPBNT = new C1NumericEdit();
            this._TxtSoTienKPB = new C1NumericEdit();
            this._Label18 = new Label();
            this._Label17 = new Label();
            this._Label16 = new Label();
            this._Panel4 = new Panel();
            this._AdvTKNo = new ADVAccount();
            this._AdvNhanVien = new ADVObjects();
            this._advNhaCungCap = new ADVObjects();
            this._AdvNganhang = new ADVObjects();
            this._AdvTaiKhoan = new ADVAccount();
            ((ISupportInitialize)this._TxtTongSoDuNo).BeginInit();
            ((ISupportInitialize)this._TxtSoTienThanhToan).BeginInit();
            ((ISupportInitialize)this._TxtSoTienThanhToanNT).BeginInit();
            this._TabControl1.SuspendLayout();
            this._TabPage1.SuspendLayout();
            ((ISupportInitialize)this._txtTyGia).BeginInit();
            this._ToolStrip1.SuspendLayout();
            ((ISupportInitialize)this._TxtSoTien).BeginInit();
            this._Panel5.SuspendLayout();
            ((ISupportInitialize)this._TxtSoTienNT).BeginInit();
            this._TabPage2.SuspendLayout();
            this._VSlist.BeginInit();
            this._TabDetails.SuspendLayout();
            ((ISupportInitialize)this._TxtSoTienKPBNT).BeginInit();
            ((ISupportInitialize)this._TxtSoTienKPB).BeginInit();
            this._Panel4.SuspendLayout();
            this.SuspendLayout();
            this._Label15.AutoSize = true;
            //Point point = new Point(8, 0x37);
            this._Label15.Location = new Point(8, 0x37);
            this._Label15.Name = "Label15";
            //Size size = new Size(0x4d, 13);
            this._Label15.Size = new Size(0x4d, 13);
            this._Label15.TabIndex = 0x73;
            this._Label15.Text = "Số dư c\x00f4ng nợ";
            this._Button1.FlatStyle = FlatStyle.System;
            //point = new Point(0xc1, 0x33);
            this._Button1.Location = new Point(0xc1, 0x33);
            //Padding padding = new Padding(0);
            this._Button1.Margin = new Padding(0);
            this._Button1.Name = "Button1";
            //size = new Size(0x16, 0x16);
            this._Button1.Size = new Size(0x16, 0x16);
            this._Button1.TabIndex = 4;
            this._Button1.Text = "...";
            this._Button1.UseVisualStyleBackColor = true;
            this._TxtTongSoDuNo.BorderStyle = BorderStyle.FixedSingle;
            this._TxtTongSoDuNo.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x59, 0x34);
            this._TxtTongSoDuNo.Location = new Point(0x59, 0x34);
            this._TxtTongSoDuNo.Name = "TxtTongSoDuNo";
            //padding = new Padding(1);
            this._TxtTongSoDuNo.Padding = new Padding(1);
            this._TxtTongSoDuNo.ReadOnly = true;
            //size = new Size(0x68, 20);
            this._TxtTongSoDuNo.Size = new Size(0x68, 20);
            this._TxtTongSoDuNo.TabIndex = 3;
            this._TxtTongSoDuNo.Tag = null;
            this._TxtTongSoDuNo.TextAlign = HorizontalAlignment.Right;
            this._TxtTongSoDuNo.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtTongSoDuNo.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtTongSoDuNo.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._Label14.AutoSize = true;
            //point = new Point(11, 0x87);
            this._Label14.Location = new Point(11, 0x87);
            this._Label14.Name = "Label14";
            //size = new Size(0x38, 13);
            this._Label14.Size = new Size(0x38, 13);
            this._Label14.TabIndex = 0x6f;
            this._Label14.Text = "Nh\x00e2n vi\x00ean";
            this._Label12.AutoSize = true;
            //point = new Point(0x255, 0x65);
            this._Label12.Location = new Point(0x255, 0x65);
            this._Label12.Name = "Label12";
            //size = new Size(0x2c, 13);
            this._Label12.Size = new Size(0x2c, 13);
            this._Label12.TabIndex = 0x6d;
            this._Label12.Text = "Quy đổi";
            this._Label12.TextAlign = ContentAlignment.TopRight;
            this._Label8.AutoSize = true;
            //point = new Point(0x185, 0x66);
            this._Label8.Location = new Point(0x185, 0x66);
            this._Label8.Name = "Label8";
            //size = new Size(0x5e, 13);
            this._Label8.Size = new Size(0x5e, 13);
            this._Label8.TabIndex = 0x6c;
            this._Label8.Text = "Số tiền thanh to\x00e1n";
            this._Label8.TextAlign = ContentAlignment.TopRight;
            this._TxtSoTienThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTienThanhToan.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x295, 0x62);
            this._TxtSoTienThanhToan.Location = new Point(0x295, 0x62);
            this._TxtSoTienThanhToan.Name = "TxtSoTienThanhToan";
            //padding = new Padding(1);
            this._TxtSoTienThanhToan.Padding = new Padding(1);
            this._TxtSoTienThanhToan.ReadOnly = true;
            //size = new Size(0x65, 20);
            this._TxtSoTienThanhToan.Size = new Size(0x65, 20);
            this._TxtSoTienThanhToan.TabIndex = 13;
            this._TxtSoTienThanhToan.Tag = null;
            this._TxtSoTienThanhToan.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTienThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTienThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTienThanhToanNT.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x1e7, 0x62);
            this._TxtSoTienThanhToanNT.Location = new Point(0x1e7, 0x62);
            this._TxtSoTienThanhToanNT.Name = "TxtSoTienThanhToanNT";
            //padding = new Padding(1);
            this._TxtSoTienThanhToanNT.Padding = new Padding(1);
            //size = new Size(0x69, 20);
            this._TxtSoTienThanhToanNT.Size = new Size(0x69, 20);
            this._TxtSoTienThanhToanNT.TabIndex = 12;
            this._TxtSoTienThanhToanNT.Tag = null;
            this._TxtSoTienThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTienThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTienThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TabControl1.Controls.Add(this._TabPage1);
            this._TabControl1.Dock = DockStyle.Top;
            //point = new Point(0, 0x19);
            this._TabControl1.Location = new Point(0, 0x19);
            this._TabControl1.Name = "TabControl1";
            this._TabControl1.SelectedIndex = 0;
            //size = new Size(0x37e, 0x97);
            this._TabControl1.Size = new Size(0x37e, 0x97);
            this._TabControl1.TabIndex = 0;
            this._TabPage1.Controls.Add(this._Label15);
            this._TabPage1.Controls.Add(this._Button1);
            this._TabPage1.Controls.Add(this._TxtTongSoDuNo);
            this._TabPage1.Controls.Add(this._AdvNhanVien);
            this._TabPage1.Controls.Add(this._Label14);
            this._TabPage1.Controls.Add(this._Label12);
            this._TabPage1.Controls.Add(this._Label8);
            this._TabPage1.Controls.Add(this._TxtSoTienThanhToan);
            this._TabPage1.Controls.Add(this._TxtSoTienThanhToanNT);
            this._TabPage1.Controls.Add(this._advNhaCungCap);
            this._TabPage1.Controls.Add(this._Label7);
            this._TabPage1.Controls.Add(this._CboHinhThuc);
            this._TabPage1.Controls.Add(this._Label6);
            this._TabPage1.Controls.Add(this._AdvNganhang);
            this._TabPage1.Controls.Add(this._Label4);
            this._TabPage1.Controls.Add(this._TxtDienGiai);
            this._TabPage1.Controls.Add(this._Label9);
            this._TabPage1.Controls.Add(this._TxtChungTuDinhKem);
            this._TabPage1.Controls.Add(this._Label3);
            this._TabPage1.Controls.Add(this._CboLoaiTien);
            this._TabPage1.Controls.Add(this._txtTyGia);
            this._TabPage1.Controls.Add(this._Label11);
            this._TabPage1.Controls.Add(this._Label10);
            this._TabPage1.Controls.Add(this._Label2);
            this._TabPage1.Controls.Add(this._AdvTaiKhoan);
            this._TabPage1.Controls.Add(this._Label13);
            this._TabPage1.Controls.Add(this._TxtNgayChungTu);
            this._TabPage1.Controls.Add(this._Label1);
            this._TabPage1.Controls.Add(this._TxtSoChungTu);
            //point = new Point(4, 0x16);
            this._TabPage1.Location = new Point(4, 0x16);
            this._TabPage1.Name = "TabPage1";
            //padding = new Padding(3);
            this._TabPage1.Padding = new Padding(3);
            //size = new Size(0x376, 0x7d);
            this._TabPage1.Size = new Size(0x376, 0x7d);
            this._TabPage1.TabIndex = 0;
            this._TabPage1.Text = "Th\x00f4ng tin chứng từ thanh to\x00e1n tiền mua h\x00e0ng";
            this._TabPage1.UseVisualStyleBackColor = true;
            this._Label7.AutoSize = true;
            //point = new Point(8, 0x21);
            this._Label7.Location = new Point(8, 0x21);
            this._Label7.Name = "Label7";
            //size = new Size(0x41, 13);
            this._Label7.Size = new Size(0x41, 13);
            this._Label7.TabIndex = 0x67;
            this._Label7.Text = "Kh\x00e1ch h\x00e0ng";
            this._CboHinhThuc.FormattingEnabled = true;
            //point = new Point(0x1e7, 5);
            this._CboHinhThuc.Location = new Point(0x1e7, 5);
            this._CboHinhThuc.Name = "CboHinhThuc";
            //size = new Size(0x113, 0x15);
            this._CboHinhThuc.Size = new Size(0x113, 0x15);
            this._CboHinhThuc.TabIndex = 7;
            this._Label6.AutoSize = true;
            //new Point(0x185, 8);point = new Point(0x185, 8);
            this._Label6.Location = new Point(0x185, 8);
            this._Label6.Name = "Label6";
            //size = new Size(0x35, 13);
            this._Label6.Size = new Size(0x35, 13);
            this._Label6.TabIndex = 0x65;
            this._Label6.Text = "H\x00ecnh thức";
            this._Label6.TextAlign = ContentAlignment.TopRight;
            this._Label4.AutoSize = true;
            ///point = new Point(0x185, 0x20);
            this._Label4.Location = new Point(0x185, 0x20);
            this._Label4.Name = "Label4";
            //size = new Size(60, 13);
            this._Label4.Size = new Size(60, 13);
            this._Label4.TabIndex = 0x63;
            this._Label4.Text = "Ng\x00e2n h\x00e0ng";
            //point = new Point(0x59, 0x62);
            this._TxtDienGiai.Location = new Point(0x59, 0x62);
            this._TxtDienGiai.Name = "TxtDienGiai";
            //size = new Size(0x126, 20);
            this._TxtDienGiai.Size = new Size(0x126, 20);
            this._TxtDienGiai.TabIndex = 6;
            this._Label9.AutoEllipsis = true;
            this._Label9.AutoSize = true;
            //point = new Point(8, 0x66);
            this._Label9.Location = new Point(8, 0x66);
            this._Label9.Name = "Label9";
            //this._Label9.RightToLeft = RightToLeft.No;
            //size = new Size(0x30, 13);
            this._Label9.Size = new Size(0x30, 13);
            this._Label9.TabIndex = 0x5f;
            this._Label9.Text = "Diễn giải";
            this._Label9.TextAlign = ContentAlignment.TopRight;
            //point = new Point(0x59, 0x4b);
            this._TxtChungTuDinhKem.Location = new Point(0x59, 0x4b);
            this._TxtChungTuDinhKem.Name = "TxtChungTuDinhKem";
            //size = new Size(0x126, 20);
            this._TxtChungTuDinhKem.Size = new Size(0x126, 20);
            this._TxtChungTuDinhKem.TabIndex = 5;
            this._Label3.AutoEllipsis = true;
            this._Label3.AutoSize = true;
            //point = new Point(8, 0x4f);
            this._Label3.Location = new Point(8, 0x4f);
            this._Label3.Name = "Label3";
            //this._Label3.RightToLeft = RightToLeft.No;
            //size = new Size(0x36, 13);
            this._Label3.Size = new Size(0x36, 13);
            this._Label3.TabIndex = 0x5d;
            this._Label3.Text = "Đ\x00ednh k\x00e8m";
            this._Label3.TextAlign = ContentAlignment.TopRight;
            this._CboLoaiTien.FormattingEnabled = true;
            //point = new Point(0x1e7, 0x4b);
            this._CboLoaiTien.Location = new Point(0x1e7, 0x4b);
            this._CboLoaiTien.Name = "CboLoaiTien";
            //size = new Size(0x69, 0x15);
            this._CboLoaiTien.Size = new Size(0x69, 0x15);
            this._CboLoaiTien.TabIndex = 10;
            this._txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this._txtTyGia.DataType = typeof(double);
            this._txtTyGia.FormatType = FormatTypeEnum.Currency;
            //point = new Point(0x295, 0x4b);
            this._txtTyGia.Location = new Point(0x295, 0x4b);
            this._txtTyGia.Name = "txtTyGia";
            //padding = new Padding(1);
            this._txtTyGia.Padding = new Padding(1);
            //size = new Size(0x65, 20);
            this._txtTyGia.Size = new Size(0x65, 20);
            this._txtTyGia.TabIndex = 11;
            this._txtTyGia.Tag = null;
            this._txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this._txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._Label11.AutoSize = true;
            //point = new Point(0x185, 0x4f);
            this._Label11.Location = new Point(0x185, 0x4f);
            this._Label11.Name = "Label11";
            //size = new Size(0x2f, 13);
            this._Label11.Size = new Size(0x2f, 13);
            this._Label11.TabIndex = 0x39;
            this._Label11.Text = "Loại tiền";
            this._Label11.TextAlign = ContentAlignment.TopRight;
            this._Label10.AutoSize = true;
            //point = new Point(0x255, 0x4f);
            this._Label10.Location = new Point(0x255, 0x4f);
            this._Label10.Name = "Label10";
            //size = new Size(0x24, 13);
            this._Label10.Size = new Size(0x24, 13);
            this._Label10.TabIndex = 0x38;
            this._Label10.Text = "Tỷ gi\x00e1";
            this._Label10.TextAlign = ContentAlignment.TopRight;
            this._Label2.AutoSize = true;
            //point = new Point(0x185, 0x38);
            this._Label2.Location = new Point(0x185, 0x38);
            this._Label2.Name = "Label2";
            //size = new Size(70, 13);
            this._Label2.Size = new Size(70, 13);
            this._Label2.TabIndex = 0x25;
            this._Label2.Text = "T\x00e0i khoản c\x00f3";
            this._Label13.AutoSize = true;
            //point = new Point(0xeb, 9);
            this._Label13.Location = new Point(0xeb, 9);
            this._Label13.Name = "Label13";
            //size = new Size(0x20, 13);
            this._Label13.Size = new Size(0x20, 13);
            this._Label13.TabIndex = 0x23;
            this._Label13.Text = "Ng\x00e0y";
            this._TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            //point = new Point(0x126, 6);
            this._TxtNgayChungTu.Location = new Point(0x126, 6);
            this._TxtNgayChungTu.Name = "TxtNgayChungTu";
            //size = new Size(0x59, 20);
            this._TxtNgayChungTu.Size = new Size(0x59, 20);
            this._TxtNgayChungTu.TabIndex = 1;
            this._Label1.AutoSize = true;
            //point = new Point(8, 9);
            this._Label1.Location = new Point(8, 9);
            this._Label1.Name = "Label1";
            //size = new Size(0x41, 13);
            this._Label1.Size = new Size(0x41, 13);
            this._Label1.TabIndex = 0x21;
            this._Label1.Text = "Số chứng từ";
            //point = new Point(0x59, 6);
            this._TxtSoChungTu.Location = new Point(0x59, 6);
            this._TxtSoChungTu.Name = "TxtSoChungTu";
            //size = new Size(0x68, 20);
            this._TxtSoChungTu.Size = new Size(0x68, 20);
            this._TxtSoChungTu.TabIndex = 0;
            //this._ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this._ToolStrip1.Items.AddRange(new ToolStripItem[] { this._CmdAdd, this._CmdEdit, this._ToolStripSeparator2, this._CmdSave, this._CmdUnsave, this._ToolStripSeparator1, this._CmdFind, this._CmdPrint, this._ToolStripButton1, this._CmdDel, this._ToolStripSeparator3, this._CmdExit, this._CmdHelp });
            //point = new Point(0, 0);
            this._ToolStrip1.Location = new Point(0, 0);
            this._ToolStrip1.Name = "ToolStrip1";
            //size = new Size(0x37e, 0x19);
            this._ToolStrip1.Size = new Size(0x37e, 0x19);
            this._ToolStrip1.TabIndex = 0x23;
            this._ToolStrip1.Text = "ToolStrip1";
            this._CmdAdd.Image = (Image)manager.GetObject("CmdAdd.Image");
            this._CmdAdd.ImageTransparentColor = Color.White;
            this._CmdAdd.Name = "CmdAdd";
            //size = new Size(0x52, 0x16);
            this._CmdAdd.Size = new Size(0x52, 0x16);
            this._CmdAdd.Text = "&Th\x00eam mới";
            this._CmdEdit.Image = (Image)manager.GetObject("CmdEdit.Image");
            this._CmdEdit.ImageTransparentColor = Color.White;
            this._CmdEdit.Name = "CmdEdit";
            //size = new Size(0x2e, 0x16);
            this._CmdEdit.Size = new Size(0x2e, 0x16);
            this._CmdEdit.Text = "&Sửa";
            this._ToolStripSeparator2.Name = "ToolStripSeparator2";
            //size = new Size(6, 0x19);
            this._ToolStripSeparator2.Size = new Size(6, 0x19);
            this._CmdSave.Image = (Image)manager.GetObject("CmdSave.Image");
            this._CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this._CmdSave.Name = "CmdSave";
            //size = new Size(0x2f, 0x16);
            this._CmdSave.Size = new Size(0x2f, 0x16);
            this._CmdSave.Text = "&Lưu";
            this._CmdUnsave.Image = (Image)manager.GetObject("CmdUnsave.Image");
            this._CmdUnsave.ImageTransparentColor = Color.White;
            this._CmdUnsave.Name = "CmdUnsave";
            //size = new Size(0x39, 0x16);
            this._CmdUnsave.Size = new Size(0x39, 0x16);
            this._CmdUnsave.Text = "&K.Lưu";
            this._ToolStripSeparator1.Name = "ToolStripSeparator1";
            //size = new Size(6, 0x19);
            this._ToolStripSeparator1.Size = new Size(6, 0x19);
            this._CmdFind.Image = (Image)manager.GetObject("CmdFind.Image");
            this._CmdFind.ImageTransparentColor = Color.White;
            this._CmdFind.Name = "CmdFind";
            //size = new Size(0x4d, 0x16);
            this._CmdFind.Size = new Size(0x4d, 0x16);
            this._CmdFind.Text = "T\x00ecm kiếm";
            this._CmdPrint.Image = (Image)manager.GetObject("CmdPrint.Image");
            this._CmdPrint.ImageTransparentColor = Color.White;
            this._CmdPrint.Name = "CmdPrint";
            //size = new Size(0x25, 0x16);
            this._CmdPrint.Size = new Size(0x25, 0x16);
            this._CmdPrint.Text = "&In";
            this._ToolStripButton1.Name = "ToolStripButton1";
            //size = new Size(6, 0x19);
            this._ToolStripButton1.Size = new Size(6, 0x19);
            this._CmdDel.Image = (Image)manager.GetObject("CmdDel.Image");
            this._CmdDel.ImageTransparentColor = Color.White;
            this._CmdDel.Name = "CmdDel";
            //size = new Size(0x2f, 0x16);
            this._CmdDel.Size = new Size(0x2f, 0x16);
            this._CmdDel.Text = "&X\x00f3a";
            this._ToolStripSeparator3.Name = "ToolStripSeparator3";
            //size = new Size(6, 0x19);
            this._ToolStripSeparator3.Size = new Size(6, 0x19);
            this._CmdExit.Alignment = ToolStripItemAlignment.Right;
            this._CmdExit.Image = (Image)manager.GetObject("CmdExit.Image");
            this._CmdExit.ImageTransparentColor = Color.White;
            this._CmdExit.Name = "CmdExit";
            //size = new Size(0x3a, 0x16);
            this._CmdExit.Size = new Size(0x3a, 0x16);
            this._CmdExit.Text = "Th&o\x00e1t";
            this._CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this._CmdHelp.Image = (Image)manager.GetObject("CmdHelp.Image");
            this._CmdHelp.ImageTransparentColor = Color.Magenta;
            this._CmdHelp.Name = "CmdHelp";
            //size = new Size(0x34, 0x16);
            this._CmdHelp.Size = new Size(0x34, 0x16);
            this._CmdHelp.Text = "&Help";
            this._TxtSoTien.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTien.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0xb6, 5);
            this._TxtSoTien.Location = new Point(0xb6, 5);
            this._TxtSoTien.Name = "TxtSoTien";
            //padding = new Padding(1);
            this._TxtSoTien.Padding = new Padding(1);
            this._TxtSoTien.ReadOnly = true;
            //size = new Size(0x61, 20);
            this._TxtSoTien.Size = new Size(0x61, 20);
            this._TxtSoTien.TabIndex = 0x58;
            this._TxtSoTien.Tag = null;
            this._TxtSoTien.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTien.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTien.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTien.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._Panel5.Controls.Add(this._TxtSoTien);
            this._Panel5.Controls.Add(this._TxtSoTienNT);
            this._Panel5.Controls.Add(this._Label5);
            this._Panel5.Dock = DockStyle.Right;
            //point = new Point(0x263, 0);
            this._Panel5.Location = new Point(0x263, 0);
            this._Panel5.Name = "Panel5";
            //size = new Size(0x11b, 0x34);
            this._Panel5.Size = new Size(0x11b, 0x34);
            this._Panel5.TabIndex = 0;
            this._TxtSoTienNT.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTienNT.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x54, 5);
            this._TxtSoTienNT.Location = new Point(0x54, 5);
            this._TxtSoTienNT.Name = "TxtSoTienNT";
            //padding = new Padding(1);
            this._TxtSoTienNT.Padding = new Padding(1);
            this._TxtSoTienNT.ReadOnly = true;
            //size = new Size(0x61, 20);
            this._TxtSoTienNT.Size = new Size(0x61, 20);
            this._TxtSoTienNT.TabIndex = 0x57;
            this._TxtSoTienNT.Tag = null;
            this._TxtSoTienNT.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTienNT.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTienNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._Label5.AutoEllipsis = true;
            this._Label5.AutoSize = true;
            this._Label5.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            //point = new Point(10, 8);
            this._Label5.Location = new Point(10, 8);
            this._Label5.Name = "Label5";
            //this._Label5.RightToLeft = RightToLeft.No;
            //size = new Size(0x41, 14);
            this._Label5.Size = new Size(0x41, 14);
            this._Label5.TabIndex = 0x4f;
            this._Label5.Text = "Tổng cộng";
            this._Label5.TextAlign = ContentAlignment.TopRight;
            this._TabPage2.Controls.Add(this._CKCheckAll);
            this._TabPage2.Controls.Add(this._VSlist);
            //point = new Point(4, 0x16);
            this._TabPage2.Location = new Point(4, 0x16);
            this._TabPage2.Name = "TabPage2";
            //padding = new Padding(3);
            this._TabPage2.Padding = new Padding(3);
            //size = new Size(0x376, 0x115);
            this._TabPage2.Size = new Size(0x376, 0x115);
            this._TabPage2.TabIndex = 0;
            this._TabPage2.Text = "Th\x00f4ng tin chi ti\x00eát";
            this._TabPage2.UseVisualStyleBackColor = true;
            this._CKCheckAll.AutoSize = true;
            //point = new Point(8, 6);
            this._CKCheckAll.Location = new Point(8, 6);
            this._CKCheckAll.Name = "CKCheckAll";
            //size = new Size(15, 14);
            this._CKCheckAll.Size = new Size(15, 14);
            this._CKCheckAll.TabIndex = 0x20;
            this._CKCheckAll.UseVisualStyleBackColor = true;
            this._VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this._VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this._VSlist.Dock = DockStyle.Fill;
            this._VSlist.ExtendLastCol = true;
            this._VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            //point = new Point(3, 3);
            this._VSlist.Location = new Point(3, 3);
            //padding = new Padding(0);
            this._VSlist.Margin = new Padding(0);
            this._VSlist.Name = "VSlist";
            this._VSlist.Rows.Count = 1;
            this._VSlist.Rows.DefaultSize = 0x11;
            this._VSlist.Rows.MinSize = 20;
            //size = new Size(880, 0x10f);
            this._VSlist.Size = new Size(880, 0x10f);
            this._VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this._VSlist.TabIndex = 0x1f;
            this._VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this._TabDetails.Controls.Add(this._TabPage2);
            this._TabDetails.Dock = DockStyle.Fill;
            //point = new Point(0, 0xb0);
            this._TabDetails.Location = new Point(0, 0xb0);
            //padding = new Padding(0);
            this._TabDetails.Margin = new Padding(0);
            this._TabDetails.Name = "TabDetails";
            this._TabDetails.SelectedIndex = 0;
            //size = new Size(0x37e, 0x12f);
            this._TabDetails.Size = new Size(0x37e, 0x12f);
            this._TabDetails.TabIndex = 0x21;
            this._TxtSoTienKPBNT.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTienKPBNT.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x6d, 5);
            this._TxtSoTienKPBNT.Location = new Point(0x6d, 5);
            this._TxtSoTienKPBNT.Name = "TxtSoTienKPBNT";
            //padding = new Padding(1);
            this._TxtSoTienKPBNT.Padding = new Padding(1);
            this._TxtSoTienKPBNT.ReadOnly = true;
            //size = new Size(0x61, 20);
            this._TxtSoTienKPBNT.Size = new Size(0x61, 20);
            this._TxtSoTienKPBNT.TabIndex = 0x67;
            this._TxtSoTienKPBNT.Tag = null;
            this._TxtSoTienKPBNT.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTienKPBNT.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTienKPBNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienKPBNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienKPB.BorderStyle = BorderStyle.FixedSingle;
            this._TxtSoTienKPB.FormatType = FormatTypeEnum.StandardNumber;
            //point = new Point(0x11c, 5);
            this._TxtSoTienKPB.Location = new Point(0x11c, 5);
            this._TxtSoTienKPB.Name = "TxtSoTienKPB";
            //padding = new Padding(1);
            this._TxtSoTienKPB.Padding = new Padding(1);
            this._TxtSoTienKPB.ReadOnly = true;
            //size = new Size(0x61, 20);
            this._TxtSoTienKPB.Size = new Size(0x61, 20);
            this._TxtSoTienKPB.TabIndex = 0x68;
            this._TxtSoTienKPB.Tag = null;
            this._TxtSoTienKPB.TextAlign = HorizontalAlignment.Right;
            this._TxtSoTienKPB.VisibleButtons = DropDownControlButtonFlags.None;
            this._TxtSoTienKPB.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._TxtSoTienKPB.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this._Label18.AutoSize = true;
            //point = new Point(9, 0x1f);
            this._Label18.Location = new Point(9, 0x1f);
            this._Label18.Name = "Label18";
            //size = new Size(70, 13);
            this._Label18.Size = new Size(70, 13);
            this._Label18.TabIndex = 0x77;
            this._Label18.Text = "T\x00e0i khoản nợ";
            this._Label17.AutoSize = true;
            //point = new Point(0xd4, 8);
            this._Label17.Location = new Point(0xd4, 8);
            this._Label17.Name = "Label17";
            //size = new Size(0x2c, 13);
            this._Label17.Size = new Size(0x2c, 13);
            this._Label17.TabIndex = 0x75;
            this._Label17.Text = "Quy đổi";
            this._Label17.TextAlign = ContentAlignment.TopRight;
            this._Label16.AutoSize = true;
            //point = new Point(8, 9);
            this._Label16.Location = new Point(8, 9);
            this._Label16.Name = "Label16";
            //size = new Size(0x5f, 13);
            this._Label16.Size = new Size(0x5f, 13);
            this._Label16.TabIndex = 0x74;
            this._Label16.Text = "Số kh\x00f4ng ph\x00e2n bổ";
            this._Panel4.Controls.Add(this._Label18);
            this._Panel4.Controls.Add(this._AdvTKNo);
            this._Panel4.Controls.Add(this._Label17);
            this._Panel4.Controls.Add(this._Label16);
            this._Panel4.Controls.Add(this._TxtSoTienKPB);
            this._Panel4.Controls.Add(this._TxtSoTienKPBNT);
            this._Panel4.Controls.Add(this._Panel5);
            this._Panel4.Dock = DockStyle.Bottom;
            //point = new Point(0, 0x1df);
            this._Panel4.Location = new Point(0, 0x1df);
            this._Panel4.Name = "Panel4";
            //size = new Size(0x37e, 0x34);
            this._Panel4.Size = new Size(0x37e, 0x34);
            this._Panel4.TabIndex = 0x22;
            this._AdvTKNo.Conditions = "";
            this._AdvTKNo.DefaultValue = "";
            this._AdvTKNo.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this._AdvTKNo.KeyFilter = "331";
            //point = new Point(0x6d, 0x1c);
            this._AdvTKNo.Location = new Point(0x6d, 0x1c);
            //padding = new Padding(0);
            this._AdvTKNo.Margin = new Padding(0);
            this._AdvTKNo.Name = "AdvTKNo";
            this._AdvTKNo.OnlyDigit = false;
            this._AdvTKNo.ReadOnly = false;
            //size = new Size(0x110, 20);
            this._AdvTKNo.Size = new Size(0x110, 20);
            this._AdvTKNo.TabIndex = 0x76;
            this._AdvTKNo.UpperText = true;
            this._AdvTKNo.Value = "";
            this._AdvTKNo.WithCode = 80;
            this._AdvNhanVien.Conditions = "";
            this._AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            //point = new Point(0x59, 0x83);
            this._AdvNhanVien.Location = new Point(0x59, 0x83);
            this._AdvNhanVien.Name = "AdvNhanVien";
            this._AdvNhanVien.ReadOnly = true;
            //size = new Size(0x126, 20);
            this._AdvNhanVien.Size = new Size(0x126, 20);
            this._AdvNhanVien.TabIndex = 110;
            this._AdvNhanVien.UpperText = true;
            this._AdvNhanVien.Value = "";
            this._AdvNhanVien.WidthCode = 80;
            this._advNhaCungCap.Conditions = "";
            this._advNhaCungCap.LoaiDoiTuong = modGeneral.TypeObjects.NhaCungCap;
            //point = new Point(0x59, 0x1d);
            this._advNhaCungCap.Location = new Point(0x59, 0x1d);
            this._advNhaCungCap.Name = "advNhaCungCap";
            this._advNhaCungCap.ReadOnly = false;
            //size = new Size(0x126, 20);
            this._advNhaCungCap.Size = new Size(0x126, 20);
            this._advNhaCungCap.TabIndex = 2;
            this._advNhaCungCap.UpperText = true;
            this._advNhaCungCap.Value = "";
            this._advNhaCungCap.WidthCode = 80;
            this._AdvNganhang.Conditions = "";
            this._AdvNganhang.LoaiDoiTuong = modGeneral.TypeObjects.NganHang;
            //point = new Point(0x1e7, 0x1d);
            this._AdvNganhang.Location = new Point(0x1e7, 0x1d);
            this._AdvNganhang.Name = "AdvNganhang";
            this._AdvNganhang.ReadOnly = false;
            //size = new Size(0x113, 20);
            this._AdvNganhang.Size = new Size(0x113, 20);
            this._AdvNganhang.TabIndex = 8;
            this._AdvNganhang.UpperText = true;
            this._AdvNganhang.Value = "";
            this._AdvNganhang.WidthCode = 80;
            this._AdvTaiKhoan.Conditions = "";
            this._AdvTaiKhoan.DefaultValue = "";
            this._AdvTaiKhoan.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this._AdvTaiKhoan.KeyFilter = "111|112";
            //point = new Point(0x1e7, 0x34);
            this._AdvTaiKhoan.Location = new Point(0x1e7, 0x34);
            //padding = new Padding(0);
            this._AdvTaiKhoan.Margin = new Padding(0);
            this._AdvTaiKhoan.Name = "AdvTaiKhoan";
            this._AdvTaiKhoan.OnlyDigit = false;
            this._AdvTaiKhoan.ReadOnly = false;
            //size = new Size(0x113, 20);
            this._AdvTaiKhoan.Size = new Size(0x113, 20);
            this._AdvTaiKhoan.TabIndex = 9;
            this._AdvTaiKhoan.UpperText = true;
            this._AdvTaiKhoan.Value = "";
            this._AdvTaiKhoan.WithCode = 80;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            //this._AutoScaleMode = AutoScaleMode.Font;
            //size = new Size(0x37e, 0x213);
            this.ClientSize = new Size(0x37e, 0x213);
            this.ControlBox = false;
            this.Controls.Add(this._TabDetails);
            this.Controls.Add(this._Panel4);
            this.Controls.Add(this._TabControl1);
            this.Controls.Add(this._ToolStrip1);
            //this._FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_ThanhToanNhaCungCap";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "MH-0008";
            this.Text = "THANH TOAN TIEN MUA HANG";
            ((ISupportInitialize)this._TxtTongSoDuNo).EndInit();
            ((ISupportInitialize)this._TxtSoTienThanhToan).EndInit();
            ((ISupportInitialize)this._TxtSoTienThanhToanNT).EndInit();
            this._TabControl1.ResumeLayout(false);
            this._TabPage1.ResumeLayout(false);
            this._TabPage1.PerformLayout();
            ((ISupportInitialize)this._txtTyGia).EndInit();
            this._ToolStrip1.ResumeLayout(false);
            this._ToolStrip1.PerformLayout();
            ((ISupportInitialize)this._TxtSoTien).EndInit();
            this._Panel5.ResumeLayout(false);
            this._Panel5.PerformLayout();
            ((ISupportInitialize)this._TxtSoTienNT).EndInit();
            this._TabPage2.ResumeLayout(false);
            this._TabPage2.PerformLayout();
            this._VSlist.EndInit();
            this._TabDetails.ResumeLayout(false);
            ((ISupportInitialize)this._TxtSoTienKPBNT).EndInit();
            ((ISupportInitialize)this._TxtSoTienKPB).EndInit();
            this._Panel4.ResumeLayout(false);
            this._Panel4.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void LoadDetails(string strKhoa)
        {
            DataTable detailsPA = this.objTT.GetDetailsPA(strKhoa);
            this.VSlist.Rows.Count = 1;
            if (detailsPA != null)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                int num2 = detailsPA.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = 1;
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["KhoaTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["SoTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["VE"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["KhoaDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TenDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["KhoaChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienThue"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["TienThue"]), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["DaThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(detailsPA.Rows[i]["ThanhToan"]);
                }
                vSlist = null;
                this.TotalOfVoucher();
            }
        }

        public void LoadThanhToan()
        {
            DataTable table = this.objTT.GetMuaHangThanhToan(LVYModule.Date2Char(this.TxtNgayChungTu.Text), modGeneral.H_CLIENT, this.cFrmKhoa, LVYModule.ReturnIfNull(this.AdvNhanVien.Value, "", modGeneral.TypeOfValue.Nothing).ToString(), LVYModule.ReturnIfNull(this.advNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString());
            this.VSlist.Rows.Count = 1;
            if (table != null)
            {
                int num2 = table.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = "NO";
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TenDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DaThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = 0;
                    vSlist = null;
                }
            }
        }

        public void LoadThanhToanEdit()
        {
            DataTable table = this.objTT.GetMuaHangThanhToan(LVYModule.Date2Char(this.TxtNgayChungTu.Text), modGeneral.H_CLIENT, this.cFrmKhoa, LVYModule.ReturnIfNull(this.AdvNhanVien.Value, "", modGeneral.TypeOfValue.Nothing).ToString(), LVYModule.ReturnIfNull(this.advNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString());
            if (table != null)
            {
                int num2 = table.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoTaiKhoan"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = "NO";
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(table.Rows[i]["KhoaDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TenDoiTuong"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(table.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(table.Rows[i]["SoChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(table.Rows[i]["NgayChungTu"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienHang"]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienChietKhau"]), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(table.Rows[i]["TienThueVAT"]), 0, modGeneral.TypeOfValue.Nothing));
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(table.Rows[i]["DaThanhToan"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = 0;
                    vSlist = null;
                }
            }
        }

        public void PhanBoSoTien()
        {
            double num2 = 0.0;
            double num3 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            int num4 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num4; i++)
            {
                num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                if (num2 > 0.0)
                {
                    if (num2 >= num3)
                    {
                        this.VSlist[i, 15] = num3;
                        num2 -= num3;
                    }
                    else
                    {
                        this.VSlist[i, 15] = num2;
                        num2 = 0.0;
                    }
                    this.VSlist[i, 1] = 1;
                }
            }
        }

        public bool SaveDetailsTemp()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[i, 1])) != 0.0)
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        vSlist[i, 0] = modGeneral.CreatKey("BH_ThanhToanChiTiet", 15, "RE");
                    }
                    this.objTTCT.Khoa = Conversions.ToString(vSlist[i, 0]);
                    this.objTTCT.KhoaTaiKhoan = Conversions.ToString(vSlist[i, 2]);
                    this.objTTCT.Ve = Conversions.ToString(vSlist[i, 4]);
                    this.objTTCT.KhoaThanhToan = this.cFrmKhoa;
                    this.objTTCT.KhoaDoiTuong = Conversions.ToString(vSlist[i, 5]);
                    this.objTTCT.KhoaChungTu = Conversions.ToString(vSlist[i, 7]);
                    this.objTTCT.SoChungTu = Conversions.ToString(vSlist[i, 8]);
                    this.objTTCT.NgayChungTu = LVYModule.Date2Char(Conversions.ToString(vSlist[i, 9]));
                    this.objTTCT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
                    this.objTTCT.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                    if (this.objTTCT.TyGia == 0.0)
                    {
                        this.objTTCT.TyGia = 1.0;
                    }
                    this.objTTCT.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienHangNT = Math.Round((double) (this.objTTCT.TienHang / this.objTTCT.TyGia), 2);
                    this.objTTCT.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 11]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienChietKhauNT = Math.Round((double) (this.objTTCT.TienChietKhau / this.objTTCT.TyGia), 2);
                    this.objTTCT.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.TienThueNT = Math.Round((double) (this.objTTCT.TienThue / this.objTTCT.TyGia), 2);
                    this.objTTCT.ThanhToan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    this.objTTCT.ThanhToanNT = Math.Round((double) (this.objTTCT.ThanhToan / this.objTTCT.TyGia), 2);
                    if (!this.objTTCT.Save())
                    {
                        return false;
                    }
                }
            }
            vSlist = null;
            return true;
        }

        public void ShowData(string strKhoa)
        {
            this.objTT.Load(strKhoa);
            clsThanhToan objTT = this.objTT;
            this.cFrmKhoa = strKhoa;
            this.TxtSoChungTu.Text = objTT.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(objTT.NgayChungTu);
            this.advNhaCungCap.Value = objTT.KhoaDoiTuong;
            this.TxtChungTuDinhKem.Text = objTT.ChungTuDinhKem;
            this.TxtDienGiai.Text = objTT.DienGiai;
            this.CboHinhThuc.SelectedValue = objTT.HinhThucThanhToan;
            this.AdvTaiKhoan.Value = objTT.KhoaTaiKhoanChu;
            this.AdvNganhang.Value = objTT.KhoaNganHang;
            this.CboLoaiTien.SelectedValue = objTT.LoaiTien;
            this.txtTyGia.Value = objTT.TyGia;
            this.TxtSoTienThanhToanNT.Value = objTT.SoTienNT;
            this.TxtSoTienThanhToan.Value = objTT.SoTien;
            this.AdvTKNo.Value = objTT.KhoaTaiKhoanDoi;
            this.TxtSoTienKPBNT.Value = objTT.SoTienKhongPhanBoNT;
            this.TxtSoTienKPB.Value = objTT.SoTienKhongPhanBo;
            this.LoadDetails(strKhoa);
            objTT = null;
        }

        public double SumColOfGrid()
        {
            double num2 = 0.0;
            int num4 = this.VSlist.Rows.Count - 1;
            for (int i = 0; i <= num4; i++)
            {
                if (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSlist[i, 1])) != 0.0)
                {
                    num2 += Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                }
            }
            return num2;
        }

        public void TotalOfVoucher()
        {
            double num = this.SumColOfGrid();
            this.TxtSoTien.Value = num;
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) != 0.0)
            {
                this.TxtSoTienNT.Value = Math.Round((double) (num / Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing))), 2);
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) > Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)))
            {
                this.TxtSoTienKPBNT.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.TxtSoTienKPB.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            }
        }

        private void TxtSoTienThanhToanNT_LostFocus(object sender, EventArgs e)
        {
            double num = 0.0;
            double num2 = 0.0;
            this.TxtSoTienThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 = this.SumColOfGrid();
            if (((LVYModule.ReturnIfNull(this.advNhaCungCap.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && ((num > num2) & (this.VSlist.Rows.Count > 1))) && LVYModule.ConfirmDelete(modGeneral.Tranlated("Bạn c\x00f3 muốn tự động ph\x00e2n bổ số tiền kh\x00f4ng?", "")))
            {
                this.PhanBoSoTien();
            }
            this.TotalOfVoucher();
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) > Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)))
            {
                this.TxtSoTienKPBNT.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.TxtSoTienKPB.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            }
            else
            {
                this.TxtSoTienKPBNT.Value = 0;
                this.TxtSoTienKPB.Value = 0;
            }
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsThanhToan objTT = this.objTT;
            objTT.Khoa = this.cFrmKhoa;
            objTT.SoChungTu = this.TxtSoChungTu.Text;
            objTT.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objTT.HinhThucThanhToan = Conversions.ToString(this.CboHinhThuc.SelectedValue);
            objTT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objTT.TyGia = Conversions.ToDouble(this.txtTyGia.Value);
            objTT.KhoaTaiKhoanChu = this.AdvTaiKhoan.Value;
            objTT.KhoaNganHang = this.AdvNganhang.Value;
            objTT.KhoaNhanVien = this.AdvNhanVien.Value;
            objTT.KhoaDoiTuong = this.advNhaCungCap.Value;
            objTT.ChungTuDinhKem = this.TxtChungTuDinhKem.Text;
            objTT.DienGiai = this.TxtDienGiai.Text;
            objTT.SoTienNT = Conversions.ToDouble(this.TxtSoTienThanhToanNT.Value);
            objTT.SoTien = Conversions.ToDouble(this.TxtSoTienThanhToan.Value);
            objTT.SoTienPhanBoNT = objTT.SoTienNT - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTT.SoTienPhanBo = objTT.SoTien - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTien.Value), 0, modGeneral.TypeOfValue.Nothing));
            objTT.KhoaDonVi = modGeneral.H_CLIENT;
            objTT.Send = 0;
            if (objTT.KhoaNhanVienTao.Trim() == "")
            {
                objTT.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objTT.NgayTao.Trim() == "")
            {
                objTT.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objTT.KhoaNhanVienSua = modGeneral.H_USERID;
            objTT.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objTT.SoTienKhongPhanBoNT = Conversions.ToDouble(this.TxtSoTienKPBNT.Value);
            objTT.SoTienKhongPhanBo = Conversions.ToDouble(this.TxtSoTienKPB.Value);
            objTT.KhoaTaiKhoanDoi = this.AdvTKNo.Value;
            objTT.LoaiChungTu = "PA";
            return objTT.Save();
            objTT = null;
            return flag;
        }

        private void VSlist_AfterEdit(object sender, RowColEventArgs e)
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            switch (e.Col)
            {
                case 1:
                    if (Conversion.Val(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 1])) != 0.0)
                    {
                        vSlist[e.Row, 15] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing));
                        this.TxtSoTienThanhToan.Value = LVYModule.SumColGrid(this.VSlist, 15);
                        this.TxtSoTienThanhToanNT.Value = Microsoft.VisualBasic.CompilerServices.Operators.DivideObject(this.TxtSoTienThanhToan.Value, this.txtTyGia.Value);
                    }
                    else
                    {
                        vSlist[e.Row, 15] = 0;
                    }
                    this.TotalOfVoucher();
                    break;

                case 15:
                    if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 15]), 0, modGeneral.TypeOfValue.Nothing)) > (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[e.Row, 14]), 0, modGeneral.TypeOfValue.Nothing))))
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Số tiền thanh to\x00e1n kh\x00f4ng thể lớn hơn số tiền ph\x00e1t sinh!", ""));
                        vSlist[e.Row, 15] = 0;
                        vSlist[e.Row, 1] = 0;
                    }
                    this.TotalOfVoucher();
                    break;
            }
            vSlist = null;
        }

        private void VSlist_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (this.AdvTaiKhoan.Value.Trim() == "")
            {
                e.Cancel = true;
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                e.Cancel = true;
            }
            else if (e.Col != 1)
            {
                if (e.Col != 15)
                {
                    e.Cancel = true;
                }
                else if ((e.Col == 15) && (Conversion.Val(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1])) == 0.0))
                {
                    e.Cancel = true;
                }
            }
        }

        public void SetEvents()
        {
            this._advNhaCungCap.ValueChanged += this.advKhachHang_ValueChanged;
            this._AdvNhanVien.ValueChanged += this.AdvNhanVien_ValueChanged;
            this._AdvTaiKhoan.ValueChanged += this.AdvTaiKhoan_ValueChanged;
            this._CboHinhThuc.SelectedIndexChanged += this.CboHinhThuc_SelectedIndexChanged;
            this._CboLoaiTien.SelectedIndexChanged += this.CboLoaiTien_SelectedIndexChanged;
            this._CmdAdd.Click += this.CmdAdd_Click;
            this._CmdDel.Click += this.CmdDel_Click;
            this._CmdEdit.Click += this.CmdEdit_Click;
            this._CmdExit.Click += this.CmdExit_Click;
            this._CmdFind.Click += this.CmdFind_Click;
            this._CmdPrint.Click += this.CmdPrint_Click;
            this._CmdSave.Click += this.CmdSave_Click;
            this._CmdUnsave.Click += this.CmdUnsave_Click;
            this._TxtSoTienThanhToanNT.LostFocus += this.TxtSoTienThanhToanNT_LostFocus;
            this._VSlist.AfterEdit += this.VSlist_AfterEdit;
            this._VSlist.BeforeEdit += this.VSlist_BeforeEdit;
        }

        internal virtual ADVObjects AdvNganhang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNganhang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNganhang = value;
            }
        }

        internal virtual ADVObjects advNhaCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._advNhaCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.advKhachHang_ValueChanged);
                if (this._advNhaCungCap != null)
                {
                    this._advNhaCungCap.ValueChanged -= handler;
                }
                this._advNhaCungCap = value;
                if (this._advNhaCungCap != null)
                {
                    this._advNhaCungCap.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhanVien_ValueChanged);
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged -= handler;
                }
                this._AdvNhanVien = value;
                if (this._AdvNhanVien != null)
                {
                    this._AdvNhanVien.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVAccount.ValueChangedEventHandler handler = new ADVAccount.ValueChangedEventHandler(this.AdvTaiKhoan_ValueChanged);
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged -= handler;
                }
                this._AdvTaiKhoan = value;
                if (this._AdvTaiKhoan != null)
                {
                    this._AdvTaiKhoan.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVAccount AdvTKNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKNo = value;
            }
        }

        internal virtual Button Button1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Button1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Button1 = value;
            }
        }

        internal virtual ComboBox CboHinhThuc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboHinhThuc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboHinhThuc_SelectedIndexChanged);
                if (this._CboHinhThuc != null)
                {
                    this._CboHinhThuc.SelectedIndexChanged -= handler;
                }
                this._CboHinhThuc = value;
                if (this._CboHinhThuc != null)
                {
                    this._CboHinhThuc.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKCheckAll
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKCheckAll;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKCheckAll = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtChungTuDinhKem.ReadOnly = !value;
                this.AdvTaiKhoan.ReadOnly = !value;
                this.CboHinhThuc.Enabled = value;
                this.advNhaCungCap.ReadOnly = !value;
                this.AdvTKNo.ReadOnly = !value;
                this.TxtSoTienThanhToanNT.ReadOnly = !value;
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
                {
                    this.TxtSoTienThanhToanNT.ReadOnly = true;
                }
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabDetails
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabDetails;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabDetails = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual TextBox TxtChungTuDinhKem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChungTuDinhKem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChungTuDinhKem = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTien = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienKPB
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienKPB;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienKPB = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienKPBNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienKPBNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienKPBNT = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNT = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoTienThanhToanNT_LostFocus);
                if (this._TxtSoTienThanhToanNT != null)
                {
                    this._TxtSoTienThanhToanNT.LostFocus -= handler;
                }
                this._TxtSoTienThanhToanNT = value;
                if (this._TxtSoTienThanhToanNT != null)
                {
                    this._TxtSoTienThanhToanNT.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTongSoDuNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongSoDuNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongSoDuNo = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlist_AfterEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlist_BeforeEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit -= handler;
                    this._VSlist.BeforeEdit -= handler2;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.AfterEdit += handler;
                    this._VSlist.BeforeEdit += handler2;
                }
            }
        }
    }
}

